import request from '@/utils/request'

// 创建质检方案
export function createInspectionScheme(data) {
  return request({
    url: '/quality/inspection-scheme/create',
    method: 'post',
    data: data
  })
}

// 更新质检方案
export function updateInspectionScheme(data) {
  return request({
    url: '/quality/inspection-scheme/update',
    method: 'put',
    data: data
  })
}

// 删除质检方案
export function deleteInspectionScheme(id) {
  return request({
    url: '/quality/inspection-scheme/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除质检方案 */
export function deleteInspectionSchemeList(ids) {
  return request({
    url: `/quality/inspection-scheme/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得质检方案
export function getInspectionScheme(id) {
  return request({
    url: '/quality/inspection-scheme/get?id=' + id,
    method: 'get'
  })
}

// 获得质检方案分页
export function getInspectionSchemePage(params) {
  return request({
    url: '/quality/inspection-scheme/page',
    method: 'get',
    params
  })
}
// 导出质检方案 Excel
export function exportInspectionSchemeExcel(params) {
  return request({
    url: '/quality/inspection-scheme/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}